package com.sporch.controller;

import com.czy.model.UserInfo;
import com.sporch.feign.RemoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConsumerController {
    @Autowired
    RemoteService remoteService;

    @RequestMapping("/hi")
    public String test(String name){
        return remoteService.remoteMethod(name);
    }

    @RequestMapping("/h2")
    public String test(@RequestBody UserInfo userInfo){
        return remoteService.remoteMethod2(userInfo);
    }
}
